__author__ = 'el_even'

from selenium.webdriver.common.by import By
from selenium.webdriver.support.expected_conditions import *

from php4dvd.pages.internalpage import InternalPage


class HomePage(InternalPage):
    """
    The homepage description
    """

    @property
    def add_button(self):
        return self.driver.find_element(By.XPATH, ".//*[@title='Add movie']")

    @property
    def search_input(self):
        return self.driver.find_element(By.CSS_SELECTOR, "#q")

    @property
    def movies(self):
        self.wait.until(presence_of_element_located((By.CSS_SELECTOR, ".movie_box")))
        movies_list = self.driver.find_elements(By.CSS_SELECTOR, ".movie_box")
        return movies_list

# OTHER BUTTONS -- skipped, not testing now
